Pandemie Dialog (PD): data and analysis migration

Author

Carl Beuchel

Published

July 19, 2023

0.1 Setup

Show the code
# define alternative package directory
r_on_cluster <- FALSE
if (r_on_cluster == TRUE) {
  bp <- "/???"
  computer <- "???"
  .libPaths(
    paste0(
      bp,
      "???",
      computer
    )
  )
} else {
  if (grepl(x = getwd(), pattern =  "carl")) {
    bp <- "/home/carl/Dokumente/06_projects/"
    
    # set a more recent R snapshot as source repo
    # r = getOption("repos") 
    # r["CRAN"] = "https://mran.microsoft.com/snapshot/2022-12-08"
    # options(repos = r)
    # rm(r)
  }
}

#+ load.packages, include=F
for (i in c(
  "renv",
  "data.table",
  "brms",
  "here",
  "broom",
  "jtools",
  "broom.mixed",
  "readxl",
  "Hmisc",
  "sparkline",
  "ggplot2",
  "scales",
  "ggrepel",
  "ggthemes",
  "corrplot",
  "cowplot",
  "plotly")
  ) {
  suppressPackageStartupMessages(
    library(i, character.only = TRUE
    ))}

# Check unsuccessful updates packages
# old.packages()

# Update packages to that snapshot
# update.packages(
#   ask = FALSE, 
#   checkBuilt = TRUE
# )

# ggplot theme
ggplot2::theme_set(
  theme_tufte(base_size = 14)  + 
    theme(panel.background = element_rect(colour = "grey35"),
          plot.background = element_rect(fill = "white", 
                                         colour = NA)
    )
)


# When within the Charite network or VPN, proxy settings need to be adapted
chariteVPN <- TRUE
if (chariteVPN) {
    Sys.setenv(https_proxy = "proxy.charite.de:8080")
    Sys.setenv(http_proxy = "proxy.charite.de:8080")
}


# Knitr should use the project root and not the script location as root
knitr::opts_knit$set(root.dir = here())
knitr::opts_knit$set(base.dir = here("scripts"))
print(here())
[1] "/home/carl/Dokumente/06_projects/2304_covid_testingSESconstraints"
Show the code
# Give data.table enough threads
writeLines(paste0("Threads available: ", parallel::detectCores()))
Threads available: 16
Show the code
writeLines(paste0("Threads given to data.table: ", parallel::detectCores() / 2))
Threads given to data.table: 8
Show the code
setDTthreads(parallel::detectCores() / 2)

# Option setup for
options(prType = 'html')
options(knitr.table.format = "html")
# options(grType = 'plotly')

0.2 Load raw data

I received the raw data for the analysis. No explanation or anything is given for any of the files.

Show the code
data_1 <- fread(here("data/raw-data/owid-covid-data_220208_22c8de6.txt"))
data_2 <- fread(here("data/raw-data/data2.txt"))
data_3 <- read_xlsx(here("data/raw-data/global burden disease region.xlsx")) |>
  as.data.table()

Three files are available for analysis:

  • data/raw-data/data2.txt: Used for the main analysis
  • data/raw-data/global burden disease region.xlsx: Gives countries for global regions used in the paper.
  • data/raw-data/owid-covid-data_220208_22c8de6.txt: Maybe the raw data

0.2.1 Explore the raw data

Find some information about the first data and use it to annotate or name it. It looks like only the file data/raw-data/data2.txt was used in the analysis.

Open Questions:

  • When was the data accessed?
  • Several variables have typos:
    • data_2: “Vccination21”

Check on basic descriptive statistics like missingness.

Show the code
# Hmisc function to quickly scan for NAs in data
contents(data_1)
data_1 Contents

Data frame:data_1

160237 observations and 67 variables, maximum # NAs:155098  
Name Class Storage NAs
iso_code character 0
continent character 0
location character 0
date IDate integer 0
total_cases double 2875
new_cases double 2909
new_cases_smoothed double 4060
total_deaths double 20477
new_deaths double 20310
new_deaths_smoothed double 20440
total_cases_per_million double 3607
new_cases_per_million double 3641
new_cases_smoothed_per_million double 4787
total_deaths_per_million double 21196
new_deaths_per_million double 21029
new_deaths_smoothed_per_million double 21159
reproduction_rate double 39346
icu_patients double 137694
icu_patients_per_million double 137694
hosp_patients double 136956
hosp_patients_per_million double 136956
weekly_icu_admissions double 155098
weekly_icu_admissions_per_million double 155098
weekly_hosp_admissions double 149821
weekly_hosp_admissions_per_million double 149821
new_tests double 94096
total_tests double 92909
total_tests_per_thousand double 92909
new_tests_per_thousand double 94096
new_tests_smoothed double 78677
new_tests_smoothed_per_thousand double 78677
positive_rate double 83915
tests_per_case double 84475
tests_units character 0
total_vaccinations double 117442
people_vaccinated double 119464
people_fully_vaccinated double 122214
total_boosters double 145084
new_vaccinations double 124688
new_vaccinations_smoothed double 81607
total_vaccinations_per_hundred double 117442
people_vaccinated_per_hundred double 119464
people_fully_vaccinated_per_hundred double 122214
total_boosters_per_hundred double 145084
new_vaccinations_smoothed_per_million double 81607
new_people_vaccinated_smoothed double 82782
new_people_vaccinated_smoothed_per_hundred double 82782
stringency_index double 34430
population double 1049
population_density double 17606
median_age double 27311
aged_65_older double 28753
aged_70_older double 28024
gdp_per_capita double 26692
extreme_poverty double 72237
cardiovasc_death_rate double 28338
diabetes_prevalence double 21427
female_smokers double 57948
male_smokers double 59416
handwashing_facilities double 94165
hospital_beds_per_thousand double 40958
life_expectancy double 10666
human_development_index double 28863
excess_mortality_cumulative_absolute double 154777
excess_mortality_cumulative double 154777
excess_mortality double 154777
excess_mortality_cumulative_per_million double 154777

Show the code
contents(data_2)
data_2 Contents

Data frame:data_2

109 observations and 41 variables, maximum # NAs:78  
Name Storage NAs
location character 0
GBDR7 character 0
Testing20 double 0
Incidence20 double 0
Mortality20 double 0
Vaccination20 double 78
Testing21 double 0
Incidence21 double 0
Mortality21 double 0
Vccination21 double 0
max20_21_tests double 0
max20_21_cases double 0
max20_21_deaths double 0
max20_21_peopleVaccinated double 0
Age double 0
GE double 0
VA double 0
PS double 0
RQ double 0
RL double 0
CC double 0
LEB double 0
EYS double 0
MYS double 0
GNI double 0
Gini double 0
Urban double 0
CHE double 0
MMR integer 0
FLB double 0
ABR double 0
SSP double 0
PSE double 0
EP double 0
VE double 0
Population integer 0
PD double 0
AAG double 0
GDP double 0
GI double 0
HDI double 0

Show the code
contents(data_3)
data_3 Contents

Data frame:data_3

113 observations and 5 variables, maximum # NAs:6  
Name Storage NAs
Country.Territory character 0
Code character 0
Region character 0
GBDR 21 character 6
GBDR7 character 0

This describe() call would be nice but currently the rendering fails when loading qreport package.

Show the code
d <- describe(data_2)
html(d, size = 80, scroll = TRUE)

Summaries can also quickly be created using the movStats() function

Show the code
# A shorthand for calculating summaries using data.table
writeLines("Number of tests 2020 per meta-region:")
Number of tests 2020 per meta-region:
Show the code
movStats(Testing20 ~ GBDR7,
         discrete = TRUE,
         data = data_2)
GBDR7 Mean Median Q1 Q3 N
Central Europe, Eastern Europe, and Central Asia 30294.771 24968.269 18129.900 41001.340 22
High-Income 61784.670 47192.225 37005.739 68743.127 31
Latin America and Caribbean 8421.696 6527.192 3807.623 10444.780 16
North Africa and Middle East 53796.457 29956.639 16143.509 39585.406 10
Southeast Asia, East Asia, and Oceania 9660.020 4544.116 2358.742 7970.958 12
Sub-Saharan Africa 3775.411 1754.962 1074.871 2931.400 18
Show the code
writeLines("Number of tests 2021 per meta-region:")
Number of tests 2021 per meta-region:
Show the code
movStats(Testing21 ~ GBDR7,
         discrete = TRUE,
         data = data_2, )
GBDR7 Mean Median Q1 Q3 N
Central Europe, Eastern Europe, and Central Asia 142091.94 69717.717 56055.562 166248.05 22
High-Income 283991.57 153484.133 107843.222 228270.25 31
Latin America and Caribbean 21841.70 18208.845 8218.167 25124.61 16
North Africa and Middle East 175106.77 80517.537 43687.407 110572.69 10
Southeast Asia, East Asia, and Oceania 50865.25 22274.571 9248.634 39619.76 12
Sub-Saharan Africa 10733.52 3711.001 2602.542 11817.16 18

Check the data sources. data_2 contains per-country information on testing, indidences, mortality etc.

Show the code
# Check number of locations
writeLines("Total number of countries:")
Total number of countries:
Show the code
data_2[, uniqueN(location)]
[1] 109
Show the code
# Number of entries per location
writeLines("Countries per meta-region:")
Countries per meta-region:
Show the code
data_2[, .N, GBDR7]
GBDR7 N
Central Europe, Eastern Europe, and Central Asia 22
High-Income 31
Latin America and Caribbean 16
North Africa and Middle East 10
Southeast Asia, East Asia, and Oceania 12
Sub-Saharan Africa 18

Create a long-form version of the data and print summary information.

Show the code
# long format helps evaluate each variable
data_2_long <- melt(data_2, id.vars = c("location", "GBDR7")) |> 
  suppressWarnings()

writeLines("Variables and missings per meta-region:")
Variables and missings per meta-region:
Show the code
data_2_long[,.(
  total_variables = uniqueN(variable),
  total_locations = uniqueN(location),
 total_NA = sum(is.na(value)),
 relative_NA = signif(sum(is.na(value))/.N, 2)
), GBDR7]
GBDR7 total_variables total_locations total_NA relative_NA
Central Europe, Eastern Europe, and Central Asia 39 22 11 0.013
High-Income 39 31 14 0.012
Latin America and Caribbean 39 16 14 0.022
North Africa and Middle East 39 10 9 0.023
Southeast Asia, East Asia, and Oceania 39 12 12 0.026
Sub-Saharan Africa 39 18 18 0.026

We also have longitudinal data available in data_1.

Show the code
writeLines("Variables and missings per meta-region (top 5):")
Variables and missings per meta-region (top 5):
Show the code
data_1[, .(measurements = uniqueN(date)), .(continent, location)][order(-measurements)] |> 
  head()
continent location measurements
South America Argentina 769
North America Mexico 769
South America Peru 769
Asia Thailand 766
Asia Taiwan 754
Asia 748
Show the code
# this is the classical longitudinal covid data
data_1[continent == "", .N, location]
location N
Africa 726
Asia 748
Europe 747
European Union 747
High income 748
International 732
Low income 716
Lower middle income 748
North America 748
Oceania 745
South America 717
Upper middle income 748
World 748

This is a nice new method to plot categorical information.

Show the code
# separately for each year to scan for differences
plot(summaryM(Mortality20 + Testing20 + Incidence20 + Vaccination20 ~ GBDR7, 
              data = data_2))

Show the code
plot(summaryM(Mortality21 + Testing21 + Incidence21 + Vccination21 ~ GBDR7,
              data = data_2))

0.3 Exploratory plots

We have several indices, some are a combination of others, like the HDI or GI.

Show the code
all_indices <- c(
  "HDI",
  "LEB",
  "EYS",
  "MYS",
  "GNI",
  "GDP",
  "CHE",
  "GI",
  "MMR",
  "ABR",
  "FLB",
  "PSE",
  "Gini",
  "UP",
  "PD",
  "EP",
  "VE",
  "AAG"
)

# I want the column names to match the proper index names
all_indices[!(all_indices %in% colnames(data_2))]
[1] "UP"
Show the code
# Correct typo in name
setnames(data_2, "Vccination21", "Vaccination21")

# UP
setnames(x = data_2, "Urban", "UP")

# I want to remember what indices are for what and how they are connected
indices_structured <- list(
  Wealth = list("HDI" = c("LEB", "EYS", "MYS", "GNI"), 
                "GDP" = c(), 
                "CHE" = c()
                ),
  Inequality = list("GI" = c("MMR", "ABR", "FLB", "PSE"),
                    "Gini" = c()
                    ),
  Demographic_SES = list("UP" = c(),
                         "PD" = c(),
                         "EP" = c(),
                         "VE" = c()
                         ),
  Governance = list("AAG" = c()),
  "Mortality" = c(),
  "Incidence" = c(),
  "Vaccination" = c(),
  "Test_Capacity" = c()
)

0.3.1 Index correlation

I can plot basic overviews of the predictor data. First plot correlation of all variables.

Show the code
#|fig-width: 8
#|fig-height: 8

tmp <- data_2[, cor(.SD, method = "spearman"), .SDcols = c(all_indices)]
corrplot(tmp, addCoef.col = "black", number.cex = .7)

Show the code
tiff(
  filename = "paper/figures/indices_spearman_corrplot.tiff", 
  height = 8, 
  width = 8,
  res = 150, 
  units = "in"
  )
corrplot(tmp, addCoef.col = "black", number.cex = .7)
dev.off()
png 
  2 

Plot correlation of indices HDI & GI and their respective sub-indices.

Show the code
#|fig-width: 5
#|fig-height: 5

for (i in list(
              c("HDI", indices_structured$Wealth$HDI),
              c("GI", indices_structured$Inequality$GI)
              )
) {
  tmp <- data_2[, cor(.SD,method = "spearman"), .SDcols = i]
  corrplot(tmp, addCoef.col = "black")
}

Show the code
# Clean up
rm(tmp)

data_2$log_GDP <- log10(data_2$GDP)
data_2$log_PD <- log10(data_2$PD)
data_2$log_GNI <- log10(data_2$GNI)
data_2$log_MMR <- log10(data_2$MMR)

# all indices with log
all_log_indices <- c("log_GDP", "log_PD", "log_GNI", "log_MMR", 
                     all_indices[!(all_indices %in% c("GDP", "PD", "GNI", "MMR"))])

# Scatter plot of index correlation
data_2[, pairs(.SD), .SDcols = c("HDI", "LEB", "EYS", "MYS", "log_GNI")]

NULL
Show the code
data_2[, pairs(.SD), .SDcols = c("GI", "log_MMR", "ABR", "FLB", "PSE")]

NULL

0.3.2 Index histograms

Basic histograms of the predictors:

Show the code
par(mfrow = c(6,3))
options(grType = 'base')
for (i in seq_along(all_log_indices)) {
  
  # i <- 1
  hist(
    unlist(data_2[, .SD, .SDcols = all_log_indices[i]]),
    main = all_log_indices[i], 
    xlab = NULL, 
    ylab = NULL
    )
}

Show the code
options(grType = 'plotly')
par(mfrow = c(1,1))

Save plot.

Show the code
tiff(
  filename = "paper/figures/indices_hist.tiff", 
  height = 12, 
  width = 6,
  res = 150, 
  units = "in"
  )

par(mfrow = c(6,3))
options(grType = 'base')
for (i in seq_along(all_log_indices)) {
  
  # i <- 1
  hist(
    unlist(data_2[, .SD, .SDcols = all_log_indices[i]]),
    main = all_log_indices[i], 
    xlab = NULL, 
    ylab = NULL
    )
}


options(grType = 'plotly')
par(mfrow = c(1,1))
dev.off()
png 
  2 

Create data for plotting.

Show the code
# For plotting by year I need to melt the data by year
data_2_year <- melt(
  data_2, 
  id.vars =  c("location", "GBDR7"), 
  measure.vars = c("Testing20", "Testing21"), 
  variable.name = "Year", 
  value.name = "Tests"
)
data_2_year[, Year := ifelse(Year == "Testing20", "2020", "2021")]

# Get log of PD for plotting
data_2$log_PD <- log10(data_2$PD)

# select my interesting indices
nci <- c("CHE", "UP", "log_PD", "EP", "GI", "VE", "Gini")

# Add the indices
m1 <- match(data_2_year$location, data_2$location)
data_2_year[, c(nci, "Population") := 
              data_2[(m1), .SD, .SDcols = c((nci), "Population")]]

# Plot data with their mean
data_2_plot <- copy(data_2_year)

# Melt again to plot all indices at the same time
data_2_plot <- melt(data_2_plot, 
                    measure.vars = nci, 
                    variable.name = "Index", 
                    value.name = "Value", 
                    variable.factor = FALSE)

0.3.3 Scatter plot of pooled data

Scatter plot of TC with independent variables:

Show the code
# Simpsons Paradox 
# ggplot(data_2_plot[Index != "GDP"]) +
p <- ggplot(data_2_plot) +
  geom_point(aes(x = Value, 
                 y = Tests, 
                 col = GBDR7, 
                 size = Population)) + 
  facet_grid(Year ~ Index, scales = "free", 
             labeller = labeller(.cols = c(CHE = "CHE", 
                                           UP = "UP",
                                           log_PD = "log(PD)",
                                           EP = "EP",
                                           GI = "GI",
                                           Gini = "Gini",
                                           VE = "VE")
                                 )
             ) + 
  scale_y_continuous(
    trans = "log10",
    labels = trans_format("log10",
                          math_format(10^.x))) +
  annotation_logticks(sides = "l", 
                      outside = T, 
                      long = grid::unit(1.5, "mm"),
                      mid = grid::unit(1.1, "mm"),
                      short = grid::unit(.8, "mm")
                      ) +
  coord_cartesian(clip = "off") +
  labs(y = "Testing", 
       x = NULL) +
  guides(size = guide_legend()) +
  
  scale_size_continuous() + 
  
  theme(legend.position = "bottom", 
        legend.direction = "vertical",
        legend.justification = "left", 
        axis.ticks.y = element_blank(),
        panel.spacing = unit(1, "lines")
        ) +
  geom_smooth(method = "lm", 
              aes(x = Value, 
                  y = Tests, 
                  group = GBDR7, 
                  col =  GBDR7), 
              se = F,
              formula = "y ~ x")

print(p)

Save.

Show the code
ggsave(p, 
       filename = "tc_regional_pooled_scatter.tiff",
       path = "paper/figures/",
       device = "tiff", 
       width = 12, 
       height = 6, 
       dpi = 150)

0.3.4 Scatter plot per region

Per-region display to illustrate the effect difference within the regions.

1 TODO Add vaccination plot

Show the code
# Simpsons Paradox 
plot_list <- vector("list", length(nci))
names(plot_list) <- nci

for (i in seq_along(names(plot_list))) {
  
  index <- names(plot_list)[i]
  
  # i <- "GI"
  p <- ggplot(data_2_plot[Index == (index)], 
         aes(x = Value, 
             y = Tests, 
             col = GBDR7, 
             size = Population)
  ) +
    geom_point() + 
    facet_grid(Year ~ GBDR7) +
    scale_y_continuous(
      trans = "log10",
      labels = trans_format("log10",
                            math_format(10^.x))) +
    annotation_logticks(sides = "l", 
                        outside = T, 
                        long = grid::unit(1.5, "mm"),
                        mid = grid::unit(0, "mm"),
                        short = grid::unit(0, "mm")
    ) +
    coord_cartesian(clip = "off") +
    labs(y = "Testing", x = index) +
    guides(size = "none") + 
    theme(legend.position = "bottom", 
          legend.direction = "vertical",
          legend.justification = "left", 
          axis.ticks.y = element_blank(),
          strip.text.x = element_blank()) +
  geom_smooth(method = "lm", 
              aes(x = Value, 
                  y = Tests, group = GBDR7), 
              col = "indianred4",
              formula = "y ~ x")
  
  # Remove all but the last legend for plotting
  if (i != length(names(plot_list))) {
    
    p <- p + theme(legend.position = "none")
    
  }
  
  # Add to list
  plot_list[[index]] <- p
  
}

# Extract the color legend to plot separately
legend <- get_legend(
  # create some space to the left of the legend
  last(plot_list)
)

# Remove from the plot to only plot extracted 
plot_list[[7]] <- plot_list[[7]] + theme(legend.position = "none")
plot_list[["Legend"]] <- legend

# Plotting
cowplot::plot_grid(plotlist = plot_list, ncol = 1)

Save

Show the code
ggsave(cowplot::plot_grid(plotlist = plot_list, ncol = 1) + 
         theme(plot.background = element_rect(fill = "white", 
                                              color = NA)), 
       filename = "tc_regional_separate_scatter.tiff",
       path = "paper/figures/",
       device = "tiff", 
       width = 8, 
       height = 20, 
       dpi = 150)

1.0.1 Boxplot of testing for each year

Testing increase between 2020 & 2021

Show the code
p1 <- ggplot(data_2_year, 
       aes(y = Tests,
           x = GBDR7, 
           fill = Year)
       ) +
  geom_boxplot() +
  annotation_logticks(sides = "b",
                      outside = TRUE) +
  theme(axis.ticks.x = element_blank()) +
  scale_y_log10(
    breaks = scales::trans_breaks("log10", function(x) 10^x),
    labels = scales::trans_format("log10", scales::math_format(10^.x))
  ) +
  coord_flip(clip = "off") +
  theme(axis.title.y = element_blank(),
        legend.position = "bottom")

1.0.2 Boxplot of Vaccination and Mortality for each year

For Vaccination

Show the code
# For plotting by year I need to melt the data by year
data_2_vacc <- melt(
  data_2, 
  id.vars =  c("location", "GBDR7"), 
  measure.vars = c("Vaccination20", "Vaccination21"), 
  variable.name = "Year", 
  value.name = "Vaccination"
)
data_2_vacc[, Year := ifelse(Year == "Vaccination20", "2020", "2021")]

p2 <- ggplot(data_2_vacc[Year == "2021"], 
       aes(y = Vaccination,
           x = GBDR7, 
           fill = Year)
       ) +
  geom_boxplot() +
  scale_fill_manual(values = scales::hue_pal()(2)[2]) +
  annotation_logticks(sides = "b",
                      outside = TRUE) +
  theme(axis.ticks.x = element_blank()) +
  scale_y_log10(
    breaks = scales::trans_breaks("log10", function(x) 10^x),
    labels = scales::trans_format("log10", scales::math_format(10^.x))
  ) +
  coord_flip(clip = "off") +
  theme(axis.title.y = element_blank(),
        legend.position = "bottom")

For Mortality

Show the code
# For plotting by year I need to melt the data by year
data_2_mort <- melt(
  data_2, 
  id.vars =  c("location", "GBDR7"), 
  measure.vars = c("Mortality20", "Mortality21"), 
  variable.name = "Year", 
  value.name = "Mortality"
)
data_2_mort[, Year := ifelse(Year == "Mortality20", "2020", "2021")]

p3 <- ggplot(data_2_mort, 
       aes(y = Mortality,
           x = GBDR7, 
           fill = Year)
       ) +
  geom_boxplot() +
  annotation_logticks(sides = "b",
                      outside = TRUE) +
  theme(axis.ticks.x = element_blank()) +
  scale_y_log10(
    breaks = scales::trans_breaks("log10", function(x) 10^x),
    labels = scales::trans_format("log10", scales::math_format(10^.x))
  ) +
  coord_flip(clip = "off") +
  theme(axis.title.y = element_blank(),
        legend.position = "bottom")

Display as cowplot

Show the code
legend <- get_legend(p1)
plot_list <- list(p1 + theme(legend.position = "none"), 
                  p3 + theme(legend.position = "none"),
                  p2 + theme(legend.position = "none"),
                  legend)

# Plotting
cp <- cowplot::plot_grid(plotlist = plot_list,
                   rel_heights = c(3,3,2,.6), 
                   ncol = 1, labels = c("A", "B", "C")) + 
         theme(plot.background = element_rect(fill = "white", 
                                              color = NA))

print(cp)

Save.

Show the code
ggsave(cp, 
       filename = "tc_vacc_mort_boxplot.tiff",
       path = "paper/figures/",
       device = "tiff", 
       width = 6, 
       height = 10, 
       dpi = 150)

1.1 New analysis - Testing

1.1.1 Rescale data

  • PD outliers could become a problem –> use log10
  • GI on a *10 scale makes the effect more interpretable (effect of changes +- 0.1 instead of +- 1)
Show the code
# Use log of PD
data_2$log_PD <- log10(data_2$PD)

# Rescale the GI to get the effect estimates in terms of 0.1 increase of GI
data_2$GI_10 <- data_2$GI * 10

# compare raw with scaled data
par(mfrow = c(2,2))
data_2[, plot(log2(Testing20) ~ PD, pch = 19)]
NULL
Show the code
data_2[, plot(log2(Testing20) ~ log_PD, pch = 19)]
NULL
Show the code
data_2[, hist(PD)]
$breaks
 [1]    0  200  400  600  800 1000 1200 1400 1600 1800 2000

$counts
 [1] 80 20  5  0  0  0  1  2  0  1

$density
 [1] 3.669725e-03 9.174312e-04 2.293578e-04 0.000000e+00 0.000000e+00
 [6] 0.000000e+00 4.587156e-05 9.174312e-05 0.000000e+00 4.587156e-05

$mids
 [1]  100  300  500  700  900 1100 1300 1500 1700 1900

$xname
[1] "PD"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"
Show the code
data_2[, hist(log_PD)]

$breaks
[1] 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5

$counts
[1]  2  8 15 32 39  9  4

$density
[1] 0.03669725 0.14678899 0.27522936 0.58715596 0.71559633 0.16513761 0.07339450

$mids
[1] 0.25 0.75 1.25 1.75 2.25 2.75 3.25

$xname
[1] "log_PD"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"
Show the code
par(mfrow = c(1,1))

# Rescale testing for overview, remove those later
data_2$log_Testing20 <- log2(data_2$Testing20)
data_2$log_Testing21 <- log2(data_2$Testing21)

data_2$log_Mortality20 <- log2(data_2$Mortality20)
data_2$log_Mortality21 <- log2(data_2$Mortality21)
Show the code
tiff(
  filename = "paper/figures/pd_transformation.tiff", 
  height = 5, 
  width = 5,
  res = 150, 
  units = "in"
  )
par(mfrow = c(2,2))
data_2[, plot(log2(Testing20) ~ PD, pch = 19)]
NULL
Show the code
data_2[, plot(log2(Testing20) ~ log_PD, pch = 19)]
NULL
Show the code
data_2[, hist(PD)]
$breaks
 [1]    0  200  400  600  800 1000 1200 1400 1600 1800 2000

$counts
 [1] 80 20  5  0  0  0  1  2  0  1

$density
 [1] 3.669725e-03 9.174312e-04 2.293578e-04 0.000000e+00 0.000000e+00
 [6] 0.000000e+00 4.587156e-05 9.174312e-05 0.000000e+00 4.587156e-05

$mids
 [1]  100  300  500  700  900 1100 1300 1500 1700 1900

$xname
[1] "PD"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"
Show the code
data_2[, hist(log_PD)]
$breaks
[1] 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5

$counts
[1]  2  8 15 32 39  9  4

$density
[1] 0.03669725 0.14678899 0.27522936 0.58715596 0.71559633 0.16513761 0.07339450

$mids
[1] 0.25 0.75 1.25 1.75 2.25 2.75 3.25

$xname
[1] "log_PD"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"
Show the code
par(mfrow = c(1,1))
dev.off()
png 
  2 

1.1.2 Select predictors

Corrplot of all variables

Show the code
all_variables <- c("log_Testing20", "log_Testing21", "Vaccination21",
                   "log_Mortality20", "log_Mortality21",
                   "GI", "Gini", "HDI", "log_GDP", "CHE", 
                   "UP", "log_PD", "EP", "VE", "AAG")

# Select coefficients not highly correlated
tmp <- data_2[, cor(.SD, method = "spearman"), 
              .SDcols = (all_variables)]

# Display correlation structure of indices again
corrplot(tmp, 
         addCoef.col = "black", 
         number.cex = 1)

Show the code
tiff(
  filename = "paper/figures/all_variables_spearman_corrplot.tiff", 
  height = 8, 
  width = 8,
  res = 150, 
  units = "in"
  )
corrplot(tmp, addCoef.col = "black", number.cex = .7)
dev.off()
png 
  2 

Pairs plot of all variables

Show the code
# Check scatter plot of all index pairs
data_2[, pairs(.SD), 
       .SDcols = (all_variables)]

NULL
Show the code
tiff(
  filename = "paper/figures/all_variables_pairs.tiff", 
  height = 11, 
  width = 11,
  res = 150, 
  units = "in"
  )
data_2[, pairs(.SD, pch = 20, cex = .8, cex.labels = .7), 
       .SDcols = (all_variables)]
NULL
Show the code
dev.off()
png 
  2 
Show the code
data_2$log_Testing20 <- NULL
data_2$log_Testing21 <- NULL
data_2$log_Mortality20 <- NULL
data_2$log_Mortality21 <- NULL

Show only the selected indices.

Show the code
# select all vars with > 0.8 correlation
tmp_filter <- tmp |> 
  as.data.table(keep.rownames = TRUE) |> 
  melt.data.table(id.vars = "rn",
                  variable.factor = FALSE)
tmp_filter <- tmp_filter[rn != variable]

# Remove indices that correlate higly!
index_filter <- c("log_GDP", "HDI", "AAG", 
                  "log_Testing20",
                  "log_Testing21",
                  "Vaccination21",
                  "log_Mortality20",
                  "log_Mortality21")

# Only take the non-correlated indices
non_correlated_indices <- tmp_filter[!(rn %in% index_filter) & 
                                       !(variable %in% index_filter), 
                                     unique(c(rn, variable))]

# Display correlation of these indices
tmp_filter <- tmp_filter[!(rn %in% index_filter) & 
             !(variable %in% index_filter)] |> 
  dcast.data.table(rn ~ variable)
tmp_filter[, rn := NULL]
tmp_filter <- tmp_filter |> as.matrix()
rownames(tmp_filter) <- colnames(tmp_filter)
diag(tmp_filter) <- 1

Plotting

Show the code
corrplot(tmp_filter, 
         addCoef.col = "black", 
         number.cex = 1.3, tl.cex = 1.5, cl.cex = 1.5)

Show the code
# Display pairwise scatter plots again
data_2[, pairs(.SD, 
               pch = 20,
               cex = .8,
               cex.labels = 1), 
       .SDcols = non_correlated_indices]

NULL

Save plots

Show the code
tiff(
  filename = "paper/figures/main_variables_spearman_corrplot.tiff", 
  height = 8, 
  width = 8,
  res = 150, 
  units = "in"
  )
corrplot(tmp_filter, 
         addCoef.col = "black", 
         number.cex = 1.3, tl.cex = 1.5, cl.cex = 1.5)

dev.off()
png 
  2 
Show the code
tiff(
  filename = "paper/figures/main_variables_pairs.tiff", 
  height = 8, 
  width = 8,
  res = 150, 
  units = "in"
  )
data_2[, pairs(.SD, 
               pch = 20,
               cex = .8,
               cex.labels = 1), 
       .SDcols = non_correlated_indices]
NULL
Show the code
dev.off()
png 
  2 

1.2 Save data

Show the code
data_2$Testing20 <- as.integer(data_2$Testing20)
data_2$Testing21 <- as.integer(data_2$Testing21)

fwrite(data_2, file = "data/clean-data/owid-data.tsv", sep = "\t")

1.3 Old analysis

1.3.1 Supplemental Code

Show the code
####################################################################################
### 1. Preparing COVID-19 related data (Testing, mortality, incidence, vaccination)
####################################################################################

### Load Global Burden Disease Classification

library(readxl)
library(tidyr)
library(dplyr)


country_classification <- readxl::read_xlsx("data/raw-data/global burden disease region.xlsx")
country_classification$GBDR7 <- as.factor(country_classification$GBDR7)


### Load COVID-19 related data

OWID <- read.csv("data/raw-data/owid-covid-data_220208_22c8de6.txt", sep = ",")

### Clean COVID-19 related data

OWID$Month <- lubridate::ceiling_date(
  as.Date(OWID$date),
  unit = "month") - 1
OWID$Year <- format(OWID$Month,"%Y")
OWID_Monthly <- OWID %>%
  dplyr::group_by(
    iso_code,
    continent,
    location,
    Month,
    Year
  ) %>%
  dplyr::summarise(
    max_total_tests_per_Month = max(total_tests, na.rm = T),
    max_total_cases_per_Month = max(total_cases, na.rm = T),
    max_total_deaths_per_Month = max(total_deaths, na.rm = T),
    max_total_peopleVaccinated_per_Month = max(people_vaccinated, na.rm = T),
    population_InMonth = median(population),
    median_age_InMonth = median(median_age),
    population_density_InMonth = median(population_density)
  ) %>%
  arrange(iso_code, Month) %>%
  filter(Month < as.Date("2022-01-01")) %>%
  filter(Month >= as.Date("2020-03-01")) %>%
  ungroup()

# Remove -Inf induced by using max(na.rm = T)
OWID_Monthly$max_total_tests_per_Month[OWID_Monthly$max_total_tests_per_Month == -Inf] <- NA
OWID_Monthly$max_total_cases_per_Month[OWID_Monthly$max_total_cases_per_Month == -Inf] <- NA
OWID_Monthly$max_total_deaths_per_Month[OWID_Monthly$max_total_deaths_per_Month == -Inf] <- NA
OWID_Monthly$max_total_peopleVaccinated_per_Month[OWID_Monthly$max_total_peopleVaccinated_per_Month == -Inf] <- NA

# Fill Missing Months with NAs
OWID_MonthlyExtended <- OWID_Monthly %>% 
  complete(
    nesting(
      location,
      iso_code,
      continent),
    Month) 

# Find Months with missing Entries
OWID_MonthlyExtended$containsNA <- apply(
  OWID_MonthlyExtended[,c(
    "max_total_tests_per_Month",
    "max_total_cases_per_Month",
    "max_total_deaths_per_Month"
  )], 1, function(y) {
    any(is.na(y))
  }
)

# Countries with values for at least 50% of Months
countriesWithValidCaseTestDeathData <- OWID_MonthlyExtended %>%
  group_by(iso_code, continent, location) %>%
  summarise(missing = sum(containsNA), total = n()) %>%
  filter(missing / total < 0.5) %>%
  ungroup()

# Calculate Values per Month from cumulative Values for Countries matching the
# number of minimal required data points
OWID_explicit_Monthly <- OWID_Monthly %>%
  filter(iso_code %in% countriesWithValidCaseTestDeathData$iso_code)

# TODO: What happens here? Variable is not used
# List Countries with missing Region (External Data)
OWID_explicit_Monthly_Region_Missing_External_Data <- left_join(
  OWID_explicit_Monthly, 
  country_classification, 
  by = c("iso_code" = "Code")
  ) %>%
  filter(is.na(Region))

# Get monthly data for countries with Region
OWID_explicid_Monthly_Region <- left_join(
  OWID_explicit_Monthly, 
  country_classification, 
  by = c("iso_code" = "Code")
  ) %>%
  filter(!is.na(Region))

OWID_cumulative_Values_End2020 <- OWID_explicid_Monthly_Region %>%
  filter(Year == "2020") %>%
  group_by(iso_code) %>%
  summarise(
    max20_tests = max(max_total_tests_per_Month, na.rm = T),
    max20_cases = max(max_total_cases_per_Month, na.rm = T),
    max20_deaths = max(max_total_deaths_per_Month, na.rm = T),
    max20_peopleVaccinated = max(max_total_peopleVaccinated_per_Month, na.rm = T)
  ) %>%
  mutate(Year2substract = "2021")

OWID_cumulative_Values_End2020$max20_tests[OWID_cumulative_Values_End2020$max20_tests == -Inf] <- NA
OWID_cumulative_Values_End2020$max20_cases[OWID_cumulative_Values_End2020$max20_cases == -Inf] <- NA
OWID_cumulative_Values_End2020$max20_deaths[OWID_cumulative_Values_End2020$max20_deaths == -Inf] <- NA
OWID_cumulative_Values_End2020$max20_peopleVaccinated[OWID_cumulative_Values_End2020$max20_peopleVaccinated == -Inf] <- NA


OWID_cumulative_Values_End2021 <- OWID_explicid_Monthly_Region %>%
  filter(Year == "2021") %>%
  group_by(iso_code) %>%
  summarise(
    max20_21_tests = max(max_total_tests_per_Month, na.rm = T),
    max20_21_cases = max(max_total_cases_per_Month, na.rm = T),
    max20_21_deaths = max(max_total_deaths_per_Month, na.rm = T),
    max20_21_peopleVaccinated = max(max_total_peopleVaccinated_per_Month, na.rm = T)
  )

regionMeta <- OWID_explicid_Monthly_Region %>%
  select(
    iso_code, 
    location, 
    GBDR7, 
    population_InMonth, 
    median_age_InMonth,
    population_density_InMonth
  ) %>%
  distinct()

YearsMax <- full_join(
  OWID_cumulative_Values_End2020, 
  OWID_cumulative_Values_End2021, 
  by = c("iso_code" = "iso_code")
  ) %>%
  mutate(
    max21_tests = max20_21_tests - coalesce(max20_tests, 0),
    max21_cases = max20_21_cases - coalesce(max20_cases, 0),
    max21_deaths = max20_21_deaths - coalesce(max20_deaths, 0),
    max21_peopleVaccinated = max20_21_peopleVaccinated - coalesce(max20_peopleVaccinated, 0)
  ) %>%
  left_join(regionMeta, by = c("iso_code" = "iso_code")) %>%
  mutate(
    max21_tests_Per100k = max21_tests / population_InMonth * 100000,
    max21_cases_Per100k = max21_cases / population_InMonth * 100000,
    max21_deaths_Per100k = max21_deaths / population_InMonth * 100000,
    max21_peopleVaccinated_Per100k = max21_peopleVaccinated / population_InMonth * 100000,
    max20_tests_Per100k = max20_tests / population_InMonth * 100000,
    max20_cases_Per100k = max20_cases / population_InMonth * 100000,
    max20_deaths_Per100k = max20_deaths / population_InMonth * 100000,
    max20_peopleVaccinated_Per100k = max20_peopleVaccinated / population_InMonth * 100000,
  )




# Variable matching
setDT(YearsMax)
YearsMax[, .()] |> head()
data_2[order(location), .(location, Testing20, Testing21)] |> head()

1.4 Session Info

Show the code
sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.1 (2023-06-16)
 os       EndeavourOS
 system   x86_64, linux-gnu
 ui       X11
 language en_US.utf8
 collate  de_DE.UTF-8
 ctype    de_DE.UTF-8
 tz       Europe/Berlin
 date     2023-07-19
 pandoc   3.1.1 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package        * version date (UTC) lib source
 abind            1.4-5   2016-07-21 [1] CRAN (R 4.3.0)
 backports        1.4.1   2021-12-13 [1] CRAN (R 4.3.0)
 base64enc        0.1-3   2015-07-28 [1] CRAN (R 4.3.0)
 bayesplot        1.10.0  2022-11-16 [1] CRAN (R 4.3.0)
 bridgesampling   1.1-2   2021-04-16 [1] CRAN (R 4.3.0)
 brms           * 2.19.0  2023-03-14 [1] CRAN (R 4.3.0)
 Brobdingnag      1.2-9   2022-10-19 [1] CRAN (R 4.3.0)
 broom          * 1.0.5   2023-06-09 [1] CRAN (R 4.3.0)
 broom.mixed    * 0.2.9.4 2022-04-17 [1] CRAN (R 4.3.0)
 callr            3.7.3   2022-11-02 [1] CRAN (R 4.3.0)
 cellranger       1.1.0   2016-07-27 [1] CRAN (R 4.3.0)
 checkmate        2.2.0   2023-04-27 [1] CRAN (R 4.3.0)
 cli              3.6.1   2023-03-23 [1] CRAN (R 4.3.0)
 cluster          2.1.4   2022-08-22 [2] CRAN (R 4.3.1)
 coda             0.19-4  2020-09-30 [1] CRAN (R 4.3.0)
 codetools        0.2-19  2023-02-01 [2] CRAN (R 4.3.1)
 colorspace       2.1-0   2023-01-23 [1] CRAN (R 4.3.0)
 colourpicker     1.2.0   2022-10-28 [1] CRAN (R 4.3.0)
 corrplot       * 0.92    2021-11-18 [1] CRAN (R 4.3.0)
 cowplot        * 1.1.1   2020-12-30 [1] CRAN (R 4.3.0)
 crayon           1.5.2   2022-09-29 [1] CRAN (R 4.3.0)
 crosstalk        1.2.0   2021-11-04 [1] CRAN (R 4.3.0)
 data.table     * 1.14.8  2023-02-17 [1] CRAN (R 4.3.0)
 digest           0.6.31  2022-12-11 [1] CRAN (R 4.3.0)
 distributional   0.3.2   2023-03-22 [1] CRAN (R 4.3.0)
 dplyr            1.1.2   2023-04-20 [1] CRAN (R 4.3.0)
 DT               0.28    2023-05-18 [1] CRAN (R 4.3.0)
 dygraphs         1.1.1.6 2018-07-11 [1] CRAN (R 4.3.0)
 ellipsis         0.3.2   2021-04-29 [1] CRAN (R 4.3.0)
 evaluate         0.21    2023-05-05 [1] CRAN (R 4.3.0)
 fansi            1.0.4   2023-01-22 [1] CRAN (R 4.3.0)
 farver           2.1.1   2022-07-06 [1] CRAN (R 4.3.0)
 fastmap          1.1.1   2023-02-24 [1] CRAN (R 4.3.0)
 forcats          1.0.0   2023-01-29 [1] CRAN (R 4.3.0)
 foreign          0.8-84  2022-12-06 [2] CRAN (R 4.3.1)
 Formula          1.2-5   2023-02-24 [1] CRAN (R 4.3.0)
 furrr            0.3.1   2022-08-15 [1] CRAN (R 4.3.0)
 future           1.32.0  2023-03-07 [1] CRAN (R 4.3.0)
 generics         0.1.3   2022-07-05 [1] CRAN (R 4.3.0)
 ggplot2        * 3.4.2   2023-04-03 [1] CRAN (R 4.3.0)
 ggrepel        * 0.9.3   2023-02-03 [1] CRAN (R 4.3.0)
 ggthemes       * 4.2.4   2021-01-20 [1] CRAN (R 4.3.0)
 globals          0.16.2  2022-11-21 [1] CRAN (R 4.3.0)
 glue             1.6.2   2022-02-24 [1] CRAN (R 4.3.0)
 gridExtra        2.3     2017-09-09 [1] CRAN (R 4.3.0)
 gtable           0.3.3   2023-03-21 [1] CRAN (R 4.3.0)
 gtools           3.9.4   2022-11-27 [1] CRAN (R 4.3.0)
 here           * 1.0.1   2020-12-13 [1] CRAN (R 4.3.0)
 highr            0.10    2022-12-22 [1] CRAN (R 4.3.0)
 Hmisc          * 5.1-0   2023-05-08 [1] CRAN (R 4.3.0)
 htmlTable        2.4.1   2022-07-07 [1] CRAN (R 4.3.0)
 htmltools        0.5.5   2023-03-23 [1] CRAN (R 4.3.0)
 htmlwidgets      1.6.2   2023-03-17 [1] CRAN (R 4.3.0)
 httpuv           1.6.11  2023-05-11 [1] CRAN (R 4.3.0)
 httr             1.4.6   2023-05-08 [1] CRAN (R 4.3.0)
 igraph           1.5.0   2023-06-16 [1] CRAN (R 4.3.0)
 inline           0.3.19  2021-05-31 [1] CRAN (R 4.3.0)
 jsonlite         1.8.5   2023-06-05 [1] CRAN (R 4.3.0)
 jtools         * 2.2.1   2022-12-02 [1] CRAN (R 4.3.0)
 knitr            1.43    2023-05-25 [1] CRAN (R 4.3.0)
 labeling         0.4.2   2020-10-20 [1] CRAN (R 4.3.0)
 later            1.3.1   2023-05-02 [1] CRAN (R 4.3.0)
 lattice          0.21-8  2023-04-05 [2] CRAN (R 4.3.1)
 lazyeval         0.2.2   2019-03-15 [1] CRAN (R 4.3.0)
 lifecycle        1.0.3   2022-10-07 [1] CRAN (R 4.3.0)
 listenv          0.9.0   2022-12-16 [1] CRAN (R 4.3.0)
 loo              2.6.0   2023-03-31 [1] CRAN (R 4.3.0)
 magrittr         2.0.3   2022-03-30 [1] CRAN (R 4.3.0)
 markdown         1.7     2023-05-16 [1] CRAN (R 4.3.0)
 Matrix           1.5-4.1 2023-05-18 [2] CRAN (R 4.3.1)
 matrixStats      1.0.0   2023-06-02 [1] CRAN (R 4.3.0)
 mgcv             1.8-42  2023-03-02 [2] CRAN (R 4.3.1)
 mime             0.12    2021-09-28 [1] CRAN (R 4.3.0)
 miniUI           0.1.1.1 2018-05-18 [1] CRAN (R 4.3.0)
 munsell          0.5.0   2018-06-12 [1] CRAN (R 4.3.0)
 mvtnorm          1.2-2   2023-06-08 [1] CRAN (R 4.3.0)
 nlme             3.1-162 2023-01-31 [2] CRAN (R 4.3.1)
 nnet             7.3-19  2023-05-03 [1] CRAN (R 4.3.0)
 pander           0.6.5   2022-03-18 [1] CRAN (R 4.3.0)
 parallelly       1.36.0  2023-05-26 [1] CRAN (R 4.3.0)
 pillar           1.9.0   2023-03-22 [1] CRAN (R 4.3.0)
 pkgbuild         1.4.1   2023-06-14 [1] CRAN (R 4.3.0)
 pkgconfig        2.0.3   2019-09-22 [1] CRAN (R 4.3.0)
 plotly         * 4.10.2  2023-06-03 [1] CRAN (R 4.3.0)
 plyr             1.8.8   2022-11-11 [1] CRAN (R 4.3.0)
 posterior        1.4.1   2023-03-14 [1] CRAN (R 4.3.0)
 prettyunits      1.1.1   2020-01-24 [1] CRAN (R 4.3.0)
 processx         3.8.1   2023-04-18 [1] CRAN (R 4.3.0)
 promises         1.2.0.1 2021-02-11 [1] CRAN (R 4.3.0)
 ps               1.7.5   2023-04-18 [1] CRAN (R 4.3.0)
 purrr            1.0.1   2023-01-10 [1] CRAN (R 4.3.0)
 R6               2.5.1   2021-08-19 [1] CRAN (R 4.3.0)
 ragg             1.2.5   2023-01-12 [1] CRAN (R 4.3.1)
 Rcpp           * 1.0.10  2023-01-22 [1] CRAN (R 4.3.0)
 RcppParallel     5.1.7   2023-02-27 [1] CRAN (R 4.3.0)
 readxl         * 1.4.2   2023-02-09 [1] CRAN (R 4.3.0)
 renv           * 0.17.3  2023-04-06 [1] CRAN (R 4.3.0)
 reshape2         1.4.4   2020-04-09 [1] CRAN (R 4.3.0)
 rlang            1.1.1   2023-04-28 [1] CRAN (R 4.3.0)
 rmarkdown        2.22    2023-06-01 [1] CRAN (R 4.3.0)
 rpart            4.1.19  2022-10-21 [2] CRAN (R 4.3.1)
 rprojroot        2.0.3   2022-04-02 [1] CRAN (R 4.3.0)
 rstan            2.21.8  2023-01-17 [1] CRAN (R 4.3.0)
 rstantools       2.3.1   2023-03-30 [1] CRAN (R 4.3.0)
 rstudioapi       0.14    2022-08-22 [1] CRAN (R 4.3.0)
 scales         * 1.2.1   2022-08-20 [1] CRAN (R 4.3.0)
 sessioninfo      1.2.2   2021-12-06 [1] CRAN (R 4.3.0)
 shiny            1.7.4   2022-12-15 [1] CRAN (R 4.3.0)
 shinyjs          2.1.0   2021-12-23 [1] CRAN (R 4.3.0)
 shinystan        2.6.0   2022-03-03 [1] CRAN (R 4.3.0)
 shinythemes      1.2.0   2021-01-25 [1] CRAN (R 4.3.0)
 sparkline      * 2.0     2016-11-12 [1] CRAN (R 4.3.0)
 StanHeaders      2.26.27 2023-06-14 [1] CRAN (R 4.3.0)
 stringi          1.7.12  2023-01-11 [1] CRAN (R 4.3.1)
 stringr          1.5.0   2022-12-02 [1] CRAN (R 4.3.0)
 systemfonts      1.0.4   2022-02-11 [1] CRAN (R 4.3.0)
 tensorA          0.36.2  2020-11-19 [1] CRAN (R 4.3.0)
 textshaping      0.3.6   2021-10-13 [1] CRAN (R 4.3.1)
 threejs          0.3.3   2020-01-21 [1] CRAN (R 4.3.0)
 tibble           3.2.1   2023-03-20 [1] CRAN (R 4.3.0)
 tidyr            1.3.0   2023-01-24 [1] CRAN (R 4.3.0)
 tidyselect       1.2.0   2022-10-10 [1] CRAN (R 4.3.0)
 utf8             1.2.3   2023-01-31 [1] CRAN (R 4.3.0)
 vctrs            0.6.3   2023-06-14 [1] CRAN (R 4.3.0)
 viridisLite      0.4.2   2023-05-02 [1] CRAN (R 4.3.0)
 withr            2.5.0   2022-03-03 [1] CRAN (R 4.3.0)
 xfun             0.39    2023-04-20 [1] CRAN (R 4.3.0)
 xtable           1.8-4   2019-04-21 [1] CRAN (R 4.3.0)
 xts              0.13.1  2023-04-16 [1] CRAN (R 4.3.0)
 yaml             2.3.7   2023-01-23 [1] CRAN (R 4.3.0)
 zoo              1.8-12  2023-04-13 [1] CRAN (R 4.3.0)

 [1] /home/carl/Dokumente/01_programs/rpackages
 [2] /usr/lib/R/library

──────────────────────────────────────────────────────────────────────────────